/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "TRAN_DAU", catalog = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TranDau.findAll", query = "SELECT t FROM TranDau t"),
    @NamedQuery(name = "TranDau.findById", query = "SELECT t FROM TranDau t WHERE t.id = :id"),
    @NamedQuery(name = "TranDau.findByTenDoiChu", query = "SELECT t FROM TranDau t WHERE t.tenDoiChu = :tenDoiChu"),
    @NamedQuery(name = "TranDau.findByTenDoiKhach", query = "SELECT t FROM TranDau t WHERE t.tenDoiKhach = :tenDoiKhach"),
    @NamedQuery(name = "TranDau.findByGioThiDau", query = "SELECT t FROM TranDau t WHERE t.gioThiDau = :gioThiDau"),
    @NamedQuery(name = "TranDau.findBySoBanThangDoiChu", query = "SELECT t FROM TranDau t WHERE t.soBanThangDoiChu = :soBanThangDoiChu"),
    @NamedQuery(name = "TranDau.findBySoBanThangDoiKhach", query = "SELECT t FROM TranDau t WHERE t.soBanThangDoiKhach = :soBanThangDoiKhach"),
    @NamedQuery(name = "TranDau.findByGioCapNhatCuoi", query = "SELECT t FROM TranDau t WHERE t.gioCapNhatCuoi = :gioCapNhatCuoi"),
    @NamedQuery(name = "TranDau.findByTrangThai", query = "SELECT t FROM TranDau t WHERE t.trangThai = :trangThai"),
    @NamedQuery(name = "TranDau.findByGioKhoiTao", query = "SELECT t FROM TranDau t WHERE t.gioKhoiTao = :gioKhoiTao"),
    @NamedQuery(name = "TranDau.findByPhutThiDau", query = "SELECT t FROM TranDau t WHERE t.phutThiDau = :phutThiDau"),
    @NamedQuery(name = "TranDau.findByMatchCode", query = "SELECT t FROM TranDau t WHERE t.matchCode = :matchCode")})
public class TranDau implements Serializable {
    
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private Integer id;
    @Size(max = 100)
    @Column(name = "TEN_DOI_CHU")
    private String tenDoiChu;
    @Size(max = 100)
    @Column(name = "TEN_DOI_KHACH")
    private String tenDoiKhach;
    @Column(name = "GIO_THI_DAU")
    @Temporal(TemporalType.TIMESTAMP)
    private Date gioThiDau;
    @Column(name = "SO_BAN_THANG_DOI_CHU")
    private Short soBanThangDoiChu;
    @Column(name = "SO_BAN_THANG_DOI_KHACH")
    private Short soBanThangDoiKhach;
    @Column(name = "GIO_CAP_NHAT_CUOI")
    @Temporal(TemporalType.TIMESTAMP)
    private Date gioCapNhatCuoi;
    @Size(max = 40)
    @Column(name = "TRANG_THAI")
    private String trangThai;
    @Column(name = "GIO_KHOI_TAO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date gioKhoiTao;
    @Size(max = 30)
    @Column(name = "PHUT_THI_DAU")
    private String phutThiDau;
    @Size(max = 100)
    @Column(name = "MATCH_CODE")
    private String matchCode;
    @OneToMany(mappedBy = "idTranDau")
    private List<TaiSuu> taiSuuList;
    @OneToMany(mappedBy = "idTranDau")
    private List<KeoChauAu> keoChauAuList;
    @OneToMany(mappedBy = "idTranDau")
    private List<KeoChauA> keoChauAList;
    @OneToMany(mappedBy = "idTranDau")
    private List<NhanDinhChuyenGia> nhanDinhChuyenGiaList;
    @OneToMany(mappedBy = "idTranDau")
    private List<KeoBanThang> keoBanThangList;
    @OneToMany(mappedBy = "idTranDau")
    private List<ThongTinTranDau> thongTinTranDauList;
    @JoinColumn(name = "ID_GIAI_DAU", referencedColumnName = "ID")
    @ManyToOne
    private GiaiDau idGiaiDau;
    @OneToMany(mappedBy = "idTranDau")
    private List<KeoChauAOnline> keoChauAOnlineList;

    public TranDau() {
    }

    public TranDau(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTenDoiChu() {
        return tenDoiChu;
    }

    public void setTenDoiChu(String tenDoiChu) {
        this.tenDoiChu = tenDoiChu;
    }

    public String getTenDoiKhach() {
        return tenDoiKhach;
    }

    public void setTenDoiKhach(String tenDoiKhach) {
        this.tenDoiKhach = tenDoiKhach;
    }

    public Date getGioThiDau() {
        return gioThiDau;
    }

    public void setGioThiDau(Date gioThiDau) {
        this.gioThiDau = gioThiDau;
    }

    public Short getSoBanThangDoiChu() {
        return soBanThangDoiChu;
    }

    public void setSoBanThangDoiChu(Short soBanThangDoiChu) {
        this.soBanThangDoiChu = soBanThangDoiChu;
    }

    public Short getSoBanThangDoiKhach() {
        return soBanThangDoiKhach;
    }

    public void setSoBanThangDoiKhach(Short soBanThangDoiKhach) {
        this.soBanThangDoiKhach = soBanThangDoiKhach;
    }

    public Date getGioCapNhatCuoi() {
        return gioCapNhatCuoi;
    }

    public void setGioCapNhatCuoi(Date gioCapNhatCuoi) {
        this.gioCapNhatCuoi = gioCapNhatCuoi;
    }

    public String getTrangThai() {
        return trangThai;
    }

    public void setTrangThai(String trangThai) {
        this.trangThai = trangThai;
    }

    public Date getGioKhoiTao() {
        return gioKhoiTao;
    }

    public void setGioKhoiTao(Date gioKhoiTao) {
        this.gioKhoiTao = gioKhoiTao;
    }

    public String getPhutThiDau() {
        return phutThiDau;
    }

    public void setPhutThiDau(String phutThiDau) {
        this.phutThiDau = phutThiDau;
    }

    public String getMatchCode() {
        return matchCode;
    }

    public void setMatchCode(String matchCode) {
        this.matchCode = matchCode;
    }

    @XmlTransient
    public List<TaiSuu> getTaiSuuList() {
        return taiSuuList;
    }

    public void setTaiSuuList(List<TaiSuu> taiSuuList) {
        this.taiSuuList = taiSuuList;
    }

    @XmlTransient
    public List<KeoChauAu> getKeoChauAuList() {
        return keoChauAuList;
    }

    public void setKeoChauAuList(List<KeoChauAu> keoChauAuList) {
        this.keoChauAuList = keoChauAuList;
    }

    @XmlTransient
    public List<KeoChauA> getKeoChauAList() {
        return keoChauAList;
    }

    public void setKeoChauAList(List<KeoChauA> keoChauAList) {
        this.keoChauAList = keoChauAList;
    }

    @XmlTransient
    public List<NhanDinhChuyenGia> getNhanDinhChuyenGiaList() {
        return nhanDinhChuyenGiaList;
    }

    public void setNhanDinhChuyenGiaList(List<NhanDinhChuyenGia> nhanDinhChuyenGiaList) {
        this.nhanDinhChuyenGiaList = nhanDinhChuyenGiaList;
    }

    @XmlTransient
    public List<KeoBanThang> getKeoBanThangList() {
        return keoBanThangList;
    }

    public void setKeoBanThangList(List<KeoBanThang> keoBanThangList) {
        this.keoBanThangList = keoBanThangList;
    }

    @XmlTransient
    public List<ThongTinTranDau> getThongTinTranDauList() {
        return thongTinTranDauList;
    }

    public void setThongTinTranDauList(List<ThongTinTranDau> thongTinTranDauList) {
        this.thongTinTranDauList = thongTinTranDauList;
    }

    public GiaiDau getIdGiaiDau() {
        return idGiaiDau;
    }

    public void setIdGiaiDau(GiaiDau idGiaiDau) {
        this.idGiaiDau = idGiaiDau;
    }

    @XmlTransient
    public List<KeoChauAOnline> getKeoChauAOnlineList() {
        return keoChauAOnlineList;
    }

    public void setKeoChauAOnlineList(List<KeoChauAOnline> keoChauAOnlineList) {
        this.keoChauAOnlineList = keoChauAOnlineList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TranDau)) {
            return false;
        }
        TranDau other = (TranDau) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.TranDau[ id=" + id + " ]";
    }
}
